package com.rrx.controller;

import com.rrx.mapper.UserMapper_fy;
import com.rrx.model.Address;
import com.rrx.model.Users;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import sun.misc.Contended;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;

/**
 * Created by Administrator on 2018/8/15.
 */
@Controller
public class UserController_fy {
    @Autowired
    UserMapper_fy userMapper_fy;
/*查询  修改*/

    @RequestMapping("/ALLFind")
    public ModelAndView findUsers(HttpServletRequest req){
    ModelAndView   modelAndView =new ModelAndView();
    String  openid =req.getParameter("openid");
    ArrayList<Users> Alllist = userMapper_fy.seeALL(openid);
    modelAndView.setViewName("index");
    if (Alllist.size()>0){
        modelAndView.addObject(Alllist);
    }else {
        modelAndView.addObject(null);
    }
    return modelAndView;
}

}
